import Layout from '@/components/Layout/Layout';
import ChatPage from '@/pages/Chat/Chat.page';
import PlantRecognize from '@/pages/plant-rec/PlantRecognize';
import { AppShell } from '@mantine/core';
import { createBrowserRouter, RouterProvider } from 'react-router-dom';
import { LoginPage } from './pages/Login/Login.page';
import { RegisterPage } from '@/pages/Register/Register.page';
import PlanDiseaseSearch from '@/pages/plan-desease-search/PlanDiseaseSearch';
import Users from '@/pages/users/Users';
import PlantDiseaseManagement from '@/pages/plan-desease-search/PlantDiseaseManagement';
import AiChat from '@/pages/Chat/AiChat';
const router = createBrowserRouter([
  {
    path: '/',
    element: <Layout />,
    children: [
      {
        path: '/plant-recognition',
        element: <PlantRecognize />,
      },
      {
        path: '/chat',
        element: <ChatPage />,
      },
      {
        path: '/ai-chat',
        element: <AiChat />,
      },
      {
        path: '/search',
        element: <PlanDiseaseSearch />,
      },
      {
        path: '/users',
        element: <Users />,
      },
      {
        path: '/plan-disease',
        element: <PlantDiseaseManagement />,
      },
    ],
  },
  {
    path: '/register',
    element: <RegisterPage />,
  },
  {
    path: '/login',
    element: <LoginPage />,
  },
]);

export function Router() {
  return (
    <AppShell>
      <RouterProvider router={router} />
    </AppShell>
  );
}
